local XZ_PLANE = Vector3.new(1, 0, 1) local function create(class, properties, parent) local inst = Instance.new(class) for p, v in pairs(properties) do inst[p] = v end inst.Parent = parent return inst end local baseTorch = Instance.new("Model") baseTorch.Name = "Torch" do local rod = Instance.new("Part") rod.Material = Enum.Material.Wood rod.BrickColor = BrickColor.new("Fawn brown") rod.Size = Vector3.new(2, 0.5, 0.5) rod.PivotOffset = CFrame.new(-1, 0, 0) * CFrame.Angles(0, 0, math.rad(-90)) rod.Parent = baseTorch local glowPart = create("Part", { CFrame = CFrame.new(1.375, 0, 0) * CFrame.Angles(0, 0, math.rad(-90)), Size = Vector3.new(0.75, 0.75, 0.75), Color = Color3.fromRGB(255, 85, 0), Material = Enum.Material.Neon, CastShadow = false }, baseTorch) create("PointLight", { Range = 16, Shadows = true, Color = Color3.fromRGB(255, 170, 0) }, glowPart) create("Fire", {}, glowPart) create("WeldConstraint", { Part0 = rod, Part1 = glowPart }, rod) baseTorch.PrimaryPart = rod end local function pickaxe() local pickaxetool = create("Tool", { Name = "Pickaxe", Grip = CFrame.new( -0.496858418, -0.571116686, 0, -5.16443883e-08, 0.707105935, 0.707107604, -5.66296876e-08, 0.707107604, -0.707105935, -1, -7.6561335e-08, 3.52504514e-09 ) }, owner.Backpack) local handle = create("Part", { Name = "Handle", Size = Vector3.new(2, 2, 0.5), }, pickaxetool) create("SpecialMesh", { MeshType = Enum.MeshType.FileMesh, MeshId = "rbxassetid://2244969151", TextureId = "rbxassetid://2244970163" }, handle) local anim = create("StringValue", { Name = "toolanim", Value = "Slash" }) local remote = Instance.new("RemoteEvent") remote.Parent = pickaxetool remote.OnServerEvent:Connect(function(player, pos) if player ~= owner then return end workspace.Terrain:FillBall(pos, 8, Enum.Material.Air) anim.Parent = pickaxetool task.wait(0.2) anim.Parent = nil end) NLS([=[local tool = script.Parent local remote = script.Parent:WaitForChild("RemoteEvent") local mouse = nil tool.Equipped:Connect(function(newMouse) mouse = newMouse end) tool.Activated:Connect(function() if not mouse then return end remote:FireServer(mouse.Hit.Position) end) tool.Unequipped:Connect(function() mouse = nil end)]=], pickaxetool) end local function torch() local torchtool = create("Tool", { Name = "Torch", Grip = CFrame.new(-0.5, 0, 0) * CFrame.Angles(0, 0, math.rad(-90)) }, owner.Backpack) local m = baseTorch:Clone() local handle = m.PrimaryPart handle.Name = "Handle" for _, child in pairs(m:GetChildren()) do child.Parent = torchtool end m:Destroy() local remote = Instance.new("RemoteEvent") remote.Parent = torchtool remote.OnServerEvent:Connect(function(player, pos, normal, part) if player ~= owner then return end if not part or not part.Parent then return end local model = baseTorch:Clone() local p = part.CFrame:PointToWorldSpace(pos) local angle if normal.Y >= 0.8 then -- Vertical angle = CFrame.new() elseif normal.Y >= -0.8 then angle = CFrame.Angles(0, math.atan2(normal.X, normal.Z), 0) * CFrame.Angles(math.rad(22.5), 0, 0) else angle = CFrame.Angles(0, 0, math.pi) end model:PivotTo(CFrame.new(p) * angle) create("WeldConstraint", {Part0 = model.PrimaryPart, Part1 = part}, model.PrimaryPart) model.Parent = workspace end) NLS([=[local tool = script.Parent local remote = script.Parent:WaitForChild("RemoteEvent") local mouse = nil local rcParams = RaycastParams.new() rcParams.FilterType = Enum.RaycastFilterType.Exclude rcParams.IgnoreWater = true tool.Equipped:Connect(function(newMouse) mouse = newMouse rcParams.FilterDescendantsInstances = {tool.Parent} end) tool.Activated:Connect(function() if not mouse then return end local result = workspace:Raycast(mouse.UnitRay.Origin, mouse.UnitRay.Direction * 1000, rcParams) if result then local part = result.Instance remote:FireServer(part.CFrame:PointToObjectSpace(result.Position), result.Normal, part) end end) tool.Unequipped:Connect(function() mouse = nil end)]=], torchtool) end pickaxe() torch()